import requests_html
from requests_html import HTMLSession

session = HTMLSession()
# session = requests.Session()

url = 'https://music.163.com/#/playlist?id=776610810'

# music_list_url = 'https://music.163.com/playlist?id=776610810'

r = session.get(url)

html: requests_html.HTML = r.html
#
# html.render()
#
# # print(html.html)
#
# print(html.search_all("iframe"))
#
# src = html.find('#g_iframe')
#
# print(src)


u = "https://www.baidu.com/s?wd=%E5%8D%8E%E4%B8%BA%E5%9B%9E%E5%BA%945g%E8%A2%AB%E7%A6%81&ie=utf-8&rsv_cq=requests-html&rsv_dl=0_right_fyb_pchot_20811"

html: requests_html.HTML = session.get(u).html

html.render()

result = html.find(".result")

for r in result:
    print(r.find('a', first=True).attrs.get('href'))
